import 'package:gold/generated/json/base/json_field.dart';
import 'package:gold/generated/json/address_model.g.dart';
import 'dart:convert';
export 'package:gold/generated/json/address_model.g.dart';

@JsonSerializable()
class AddressModel {
	/// 地址ID
	int? id;
	@JSONField(name: "user_id")
	int? userId;
	/// N：未知、M：男、F：女
	String? sex;
	/// 联系人
	String? name;
	/// 联系电话
	String? phone;
	/// 详细地址
	String? address;
	/// 门牌号
	@JSONField(name: "house_number")
	String? houseNumber;
	/// 0=不默认，1=默认
	@JSONField(name: "is_default")
	int? isDefault;
	@JSONField(name: "created_at")
	String? createdAt;
	@JSONField(name: "updated_at")
	String? updatedAt;

	AddressModel();

	factory AddressModel.fromJson(Map<String, dynamic> json) => $AddressModelFromJson(json);

	Map<String, dynamic> toJson() => $AddressModelToJson(this);

	@override
	String toString() {
		return jsonEncode(this);
	}
}